///
/// View
///

// Constants
var view_welcome_prefix = "v_welcome_";

// Calls

function buildWelcomeView() {
  // Getting view
  var view = getNewView(view_welcome_prefix + "view");
  
  var div = getNewElement("div", null, {"id": view_welcome_prefix + "action_create", "className": "action"});
  div.innerHTML = "Create new token.";
  div.addEventListener("click", cb_createToken, false);
  view.appendChild(div);
  div = getNewElement("div", null, {"id": view_welcome_prefix + "action_list", "className": "action"});
  div.innerHTML = "List my tokens.";
  div.addEventListener("click", cb_listTokens, false);
  view.appendChild(div);
  
  // Appending view to content
  appendToContent(view);
}

// View elements action event callback

function cb_createToken(e) {
  alert("create");  
  buildCreateTokenView();
}

function cb_listTokens(e) {
  alert("list");
}

